package com.hu.dao.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * user
 *
 * @author tomsun28
 * @date 8:08 2018/4/22
 */
@Data
@Builder
@TableName("auth_user")
public class AuthUserBO extends BaseBO {
    @Tolerate
    public AuthUserBO() {
    }
    private String realOrgId;

    private String username;

    private String password;

    private String salt;

    private String realName;

    private String avatar;

    private String phone;

    private String email;

    private Byte sex;

    private Byte status;

    private String origin;

    private String rosterTag;

    private String maritalStatus;

    private String birthday;

    private String nationality;

    private String nation;

    private String political;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value="entry_time")
    private Date entryTime;

    private String postName;

    private String postLevel;

    private String postSeries;

    private String postGroups;

    private String idType;

    private String idNum;

    private String firstEdu;

    private String highestEdu;

    private String isMember;

    private String groups;

    private String enterpriseWechatCode;
    @JsonProperty("number")
    private String staffCode;
    @TableField(exist=false)
    private String deptName;

    /**
     * 员工公司工会编号
     */
    @TableField(exist=false)
    private Long companyVorgId;

    /**
     * 员工所在工会名称
     */
    @TableField(exist=false)
    private Long vorgId;
    /**
     * 员工所在工会名称
     */
    @TableField(exist=false)
    private String vorgName;

    @TableField(exist=false)
    private Long deputationId;

    /**
     * 在职状态
     */
    private String jobStatus;

    /**
     * 控股ehr用户状态
     */
    private String ehrStatus;

    /**
     * 股份ehr用户状态
     */
    private String ehrIpoStatus;

    /**
     * SAP用户状态
     */
    private String sapStatus;

    /**
     * 是否职工代表
     * @return
     */
    @TableField(exist=false)
    private Integer represent;

    @TableField("log_error_count")
    private Integer logErrorCount;

    @TableField("lock_mark")
    private Integer lockMark;

    @TableField("unlock_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date unlockTime;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
